<?php
/**
 * Created by PhpStorm.
 * User: changyifan
 * Date: 2018/1/26
 * Time: 下午3:51
 * 学院模型
 */

namespace Home\Model;
use Think\Model\BaseModel;
class SchoolModel extends BaseModel {



    
    protected $_link = array(
          'Teacher' => array(
              'mapping_type' => self::BELONGS_TO,
              'class_name' => 'Teacher',
              'foreign_key' => 'tea_id',
              'mapping_fields' => 'tea_name',
              'as_fields' => 'tea_name'
          ),
    );
	public function getCollegeInfoListByAll(){
        $result = $this->select();

		if($result){
			return $result;
		}else{
			return array();
		}
        
    }

    public function getCollegeInfoListWithTeacherName(){
        $result = $this ->relation(true) -> select();
        if($result){
			return $result;
		}else{
			return array();
		}
        
    }





}